package br.edu.ufcg.fpc;

/**
 * Protege a regiao critica utilizando o modificador synchronized.
 */
public class SynchronizedCR extends CriticalRegion {

	@Override
	protected void executeCriticalRegion() {
		long before = System.nanoTime();
		synchronized (FILE) {
			addTime(System.nanoTime() - before);
			increment();
		}
	}

}
